package com.example.titleview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

public class TitleView extends FrameLayout {
    private ImageView img;
    private TextView tv;
    
	public TitleView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public TitleView(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater.from(context).inflate(R.layout.title_view,this,true);
		img=(ImageView)findViewById(R.id.iv);
		tv=(TextView)findViewById(R.id.tv);
	}

	public TitleView(Context context) {
		super(context);
	}
	
	public void setTextViewtext(String str){
		tv.setText(str);
	}
	
	public void setImageViewbg(int id){
		img.setBackgroundResource(id);
	}

}
